<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <ol>
        <todo-item
                v-for="item in groceryList"
                v-bind:todo="item"
                v-bind:key="item.id">
        </todo-item>
    </ol>
</div>
<script src="vue.js"></script>
<script>
    Vue.component('todo-item', {
        props: ['todo'],
        template: '<li>{{todo.text}}</li>'
    });
    let vm = new Vue({
        el: '#app',
        data: {
            groceryList: [
                {id: 0, text: '蔬菜'},
                {id: 1, text: '蔬菜1'},
                {id: 2, text: '蔬菜2'},
                {id: 3, text: '蔬菜3'}
            ]
        }
    })
</script>
</body>
</html>